﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Event_SG_EWDT.CustomWebUserControls
{
    public partial class CustomTimePicker : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        
        public DateTime GetTime()
        {
            int modifier = 0;

            switch (tbxAMPM.Text)
            {
                case "AM" :
                    modifier = 0;
                    break;
                case "PM":
                    modifier = 12;
                    break;
            }


            return new DateTime(2011, 1, 1, Convert.ToInt32(tbxHour.Text) + modifier, Convert.ToInt32(tbxMinute.Text), 0);
        }
    }
}